<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>北京尚学堂首页</title>
</head>
<body>
<span th:text="北京尚学堂"></span>
<hr/>
<span th:text="${msg}"></span>
<hr/>
<input th:value="${msg}">
<hr/>
<span th:text="${#strings.isEmpty(msg)}"></span>
<hr/>
<span th:text="${#strings.contains(msg,'s')}"></span>
<hr/>
<span th:text="${#strings.length(msg)}"></span>
<hr/>
<span th:text="${#dates.format(date)}"></span>
<hr/>
<span th:text="${#dates.format(date,'yyyy/MM/dd')}"></span>
<hr/>
<span th:text="${#dates.year(date)}"></span>
<span th:text="${#dates.month(date)}"></span>
<span th:text="${#dates.day(date)}"></span>
<hr/>
<div>
        <span th:if="${sex} == '男'">
            性别：男
        </span>
    <span th:if="${sex} == '女'">
            性别：女
        </span>
</div>
<hr/>
<div th:switch="${id}">
    <span th:case="1">ID为1</span>
    <span th:case="2">ID为2</span>
    <span th:case="3">ID为3</span>
    <span th:case="*">ID为*</span>
</div>
<hr/>
<table border="1" width="50%">
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Age</th>
    </tr>
    <tr th:each="u : ${list}">
        <td th:text="${u.id}"></td>
        <td th:text="${u.name}"></td>
        <td th:text="${u.age}"></td>
    </tr>
</table>
<hr/>
<table border="1" width="50%">
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Age</th>
        <th>Index</th>
        <th>Count</th>
        <th>Size</th>
        <th>Odd</th>
        <th>Even</th>
        <th>First</th>
        <th>Last</th>
    </tr>
    <tr th:each="u,suibian : ${list}">
        <td th:text="${u.id}"></td>
        <td th:text="${u.name}"></td>
        <td th:text="${u.age}"></td>
        <td th:text="${suibian.index}"></td>
        <td th:text="${suibian.count}"></td>
        <td th:text="${suibian.size}"></td>
        <td th:text="${suibian.odd}"></td>
        <td th:text="${suibian.even}"></td>
        <td th:text="${suibian.first}"></td>
        <td th:text="${suibian.last}"></td>
    </tr>
</table>
<hr/>
<table border="1" width="50%">
    <tr>
        <th>Value</th>
    </tr>
    <tr th:each="m : ${map}">
        <td th:text="${m}"></td>
    </tr>
</table>
<hr/>
<table border="1" width="50%">
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Age</th>
        <th>Key</th>
    </tr>
    <tr th:each="m : ${map}">
        <td th:text="${m.value.id}"></td>
        <td th:text="${m.value.name}"></td>
        <td th:text="${m.value.age}"></td>
        <td th:text="${m.key}"></td>
    </tr>
</table>
<hr/>
HttpServletRequest: <span th:text="${#request.getAttribute('req')}"/>
<span th:text="${#httpServletRequest.getAttribute('req')}"/>
<hr/>
HttpSession: <span th:text="${session.ses}"/>
<span th:text="${#httpSession.getAttribute('ses')}"/>
<hr/>
Application: <span th:text="${application.app}"/>
<span th:text="${#servletContext.getAttribute('app')}"/>

<hr/>
<a th:href="@{http://www.baidu.com}">打开百度</a>
<hr/>
<a th:href="@{/show2}">打开Index2</a>
<hr/>
<a th:href="@{/show2?id=1&name=admin}">普通URL传递参数方式一</a>
<hr/>
<a th:href="@{/show2(id=2,name=kevin)}">普通URL传递参数方式二</a>
<hr/>
<a th:href="@{'/show2?id='+${id}+'&name='+${name}}">普通URL传递参数方式三</a>
<hr/>
<a th:href="@{/show2(id=${id},name=${name})}">普通URL传递参数方式四</a>
<hr/>
<a th:href="@{/show3/{id}(id=200)}">restful格式传递参数方式一</a>
<hr/>
<a th:href="@{/show3/{id}/{name}(id=200,name=admin)}">restful格式传递参数方式二</a>
<hr/>
<a th:href="@{/show4/{id}(id=200,name=admin)}">restful格式传递参数方式三</a>
<hr/>
<a th:href="@{/show4/{id}(id=${id},name=${name})}">restful格式传递参数方式四</a>
</body>
</html>